<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

//include_once('../views/cas/CAS.php');

class Arch extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/arch
	 *	- or -  
	 * 		http://example.com/index.php/arch/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/arch/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		$this->load->view('visitor');
	}

	public function layout()
	{
		$this->load->view('layout');
	}
	

	//获取parent 节点下的children
	public function getChildren()
	{
			
	}
	
	public function op()
	{
		$this -> load ->view('op');
	}
	public function login()
	{
		$this->load->view('cas/login');
	}
	public function casDemon()
	{
		$this->load->view('cas/example');
	}
	public function rse()
	{
		$this->load->view('rse');
	}
	public function kv()
	{
		$this->load->view('kv');
	}
	public function db()
	{
		$this->load->model('services_model');
		$data = $this->services_model->get_services();
		$this->load->view('db',$data);
	}
	public function perm()
	{
		$this ->load->model('permission');
		
	}
	public function test()
	{
		$this ->load->view('view');
		
	}
	public function visitor()
	{
		$this -> load -> view('visitor');
	}

	public function home()
	{
		$username = $this->uri->segment(3);
		if ($username != $_COOKIE['username']) {
			echo 'oooooops! Relogin please!';
		}else {
			$this->load->model('permission');
                      	$perm = $this->permission->getRole($username);
			setcookie('perm', $perm, time() + 3600 * 24 * 100, "/");
			$this ->load->view('home');
		}
	}
}


/* End of file arch.php */
/* Location: ./application/controllers/arch.php */
